<?php
class apibaseAction extends baseAction{

	protected function getUserInfo(){
		//print_r($_REQUEST);
		$token                = $this->_request('token','mysql_escape_string','');
		if($token==''){
			$user['id'] = 0;
		}else{
			$user=M('User')->where(array('token'=>$token))->field('id,userName')->find();
			if(empty($user)){
				$user['id'] = 0;
			}
		}
		return $user;
	}
	
	/**
	 * 格式化返回用户信息
	 */	
	protected  function FormatUserInfo($v){
	   unset($v['passWord']);
	   return $v;
		if(!empty($v)){
			$arr['userName']            = $v['userName'];
			$arr['fanCount']             = $v['fans'];
			$arr['followCount']         = $v['follows'];
			$arr['userAvatar']           = UserthunPic($v['avatar']);
			$arr['email']                   = $v['email'];
			$arr['userId']                      = $v['id'];
			$arr['statusCount']         =$v['photo'];
			$arr['intro']                     =$v['intro'];
				
		}
		return $arr;
	}
    
    protected function md5Psw($Psw){
        return md5('wudong8.taobao.com'.$Psw);
    }
}

?>